package com.paranoidmonkey.ode;

public class Ray extends Geom{
	public Ray(Space space, float length){
		handle=AndrODE.dCreateRay(space.handle, length);
	}

	public void setLength(float length){
		AndrODE.dGeomRaySetLength(handle, length);
	}

	public float getLength(){
		return AndrODE.dGeomRayGetLength(handle);
	}

	public void set(float px, float py, float pz, float dx, float dy, float dz){
		AndrODE.dGeomRaySet(handle, px, py, pz, dx, dy, dz);
	}

	public void get(Vector3 start, Vector3 dir){
		AndrODE.dGeomRayGet(handle, start.data, dir.data);
	}

	public void setParams(int FirstContact, int BackfaceCull){
		AndrODE.dGeomRaySetParams(handle, FirstContact, BackfaceCull);
	}

	public int[] getParams(){
		int[] FirstContact=new int[1], BackfaceCull=new int[1];
		AndrODE.dGeomRayGetParams(handle, FirstContact, BackfaceCull);
		return new int[]{FirstContact[0],BackfaceCull[0]};
	}

	public void setClosestHit(int closestHit){
		AndrODE.dGeomRaySetClosestHit(handle, closestHit);
	}

	public int getClosestHit(){
		return AndrODE.dGeomRayGetClosestHit(handle);
	}

}
